'''
Created on Mar 21, 2012

@author: josh
'''
from app.GHT.agents.base import BaseAgent
from app.GHT.model.db import Videos

class VideoAgent():
    
    def __init__(self):
        self.base = BaseAgent()
    
    def loadVideo(self,video_id):
        pass
    
    def loadAllVideos(self):
        """
        Load all Videos from all Vendors
        """
        query_data = Videos.all()
        query_data.order('seq')
        
        #convert to json object
        json_query_data = self.base.gql_json_parser(query_data)
        
        return json_query_data
        
    def loadAllVideosByVendor(self,vendor):
        query_data = Videos.all().filter("vendor =", vendor)
        query_data.order('seq')
        
        #convert to json object
        json_query_data = self.base.gql_json_parser(query_data)
        
        return json_query_data